<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        ul{
            width: 1280px;
            height: 48px;
            margin: 100px auto;
            background-color: #c7c6c6;
        }
        a{
            /*将行内元素转为块元素*/
            display: block;
            width: 100px;
            height: 48px;
            text-decoration: none;
            text-align: center;
            padding: 0px 39px;
            float: left;
            font-size: 18px;
            /*将文字在父元素中垂直居中*/
            line-height: 48px;
            color: #333333;
        }
        ul>a:active{
            background-color: #cc0000;
            color: white;
        }
        ul>a:hover{
            background-color: #008CFF;
            color: white;
        }

    </style>
</head>
<body>
<ul>
    <a href="">HTML/CSS</a>
    <a href="">Browser&nbsp;Sild</a>
    <a href="">Server&nbsp;Sild</a>
    <a href="">Programming</a>
    <a href="">XML</a>
    <a href="">Web&nbsp;Building</a>
    <a href="">Reference</a>
</ul>
</body>
</html>